import React from 'react';
import GlobalFooter from '../components/GlobalFooter';
import styles from './UserLayout.less';
import { corpName } from '../../config';

const { Fragment } = React;
let imgUrl = 'images/loginBg.jpg';
if (location.search.length >= 2)
  imgUrl = 'images/loginBg' + new Date().getDay() + '.jpg';
imgUrl = 'url(' + imgUrl + ')';

class UserLayout extends React.PureComponent {
  render() {
    const { children } = this.props;
    return (
      <div className={styles.container} style={{ backgroundImage: imgUrl }}>
        <div className={styles.content}>
          {children}
        </div>
        <GlobalFooter copyright={<Fragment>{corpName}</Fragment>} />
      </div>
    );
  }
}

export default UserLayout;
